import Vue from "vue";
import VueRouter from "vue-router";

// 导入需要配置的路由组件
import login from "../pages/Login.vue"
import nav from "../pages/doc/nav.vue"
import pest from "../pages/doc/pest.vue"

Vue.use(VueRouter)

// 创建常量 配置路由和组件的映射
const routes = [
   // {path:'url',component:组件} 
   {path:'/login',component:login},
   {path:'/nav',component:nav,
    children:[
        {path:'/pest',component:pest}
        
    
    ]}
]

// 建立router对象
export default new VueRouter({
    mode:'history',
    routes
})